import fetch from '@/utils/fetch'
// 显示表格信息
export const GetTable = (page, per_page = 10, keyword) => {
  return fetch({
    url: '/api/staff/sign-in?include=card,signed_by&keyword',
    method: 'get',
    params: {
      page,
      per_page,
      keyword
    }
  })
}
// 用手机签到显示用户信息，缺少的字段可以用include增加
export const getByMobile = (phone) => {
  return fetch({
    url: `/api/staff/sign-in/mobile/${phone}?include=avatar`,
    method: 'get'
  })
}
// 签到
export const MobileSign = (data) => {
  return fetch({
    url: '/api/staff/sign-in/mobile',
    method: 'post',
    data
  })
}
// 通过二维码签到显示用户信息
export const getByQrcode = (code) => {
  return fetch({
    url: `/api/staff/sign-in/qrcode/${code}?include=avatar`,
    method: 'get'
  })
}
// 激活会员卡
export const ActiveCard = (id,data) => {
  return fetch({
    url: `/api/staff/cards/${id}/active`,
    method: 'post',
    data
  })
}
